Skip to content

fix(hitl): build the full enabled-block DAG so any persisted resume target exists#5313

Merged
icecrasher321 merged 1 commit into
stagingfrom
fix/hitl-executor
Jul 1, 2026
Merged

fix(hitl): build the full enabled-block DAG so any persisted resume target exists#5313
icecrasher321 merged 1 commit into
stagingfrom
fix/hitl-executor

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Fixes HITL resume execution by building the full enabled-block DAG for snapshot resumes, so persisted remainingEdges can reach downstream targets even when the workflow has a disconnected starter.

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 1, 2026 3:54am

Request Review

@cursor

cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes core DAG construction for snapshot resumes only, but incorrect reachability could affect HITL and other pause/resume flows.

Overview
Fixes HITL snapshot resume when the workflow has a disconnected starter (e.g. a default starter block not wired to the webhook/HITL path). In that case, trigger-only DAG construction could omit downstream resume targets, so persisted remainingEdges could not reach blocks like the post-HITL step.

DAGExecutor.execute() now passes includeAllBlocks: true to DAGBuilder.build() when resumeFromSnapshot is set—the same full enabled-block DAG behavior already used for run-from-block.

A regression test covers webhook → HITL → generate-report with an isolated starter and asserts the resumed DAG includes generate-report with an edge from hitl.

Reviewed by Cursor Bugbot for commit 19fcec9. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes snapshot resume DAG construction for HITL workflows. The main changes are:

  • Builds the full enabled-block DAG when resuming from a snapshot.
  • Preserves downstream resume targets referenced by persisted remainingEdges.
  • Adds a regression test for a disconnected starter with a HITL continuation.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • Snapshot resumes still queue explicit continuation work instead of automatically running every enabled block.
  • Disabled blocks remain excluded from the expanded DAG.

Important Files Changed

Filename Overview
apps/sim/executor/execution/executor.ts Adds full enabled-block DAG construction for snapshot resumes so persisted continuation edges can resolve their targets.
apps/sim/executor/execution/executor.test.ts Adds regression coverage for a disconnected starter workflow whose HITL resume target must still exist in the DAG.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Snapshot resume] --> B[DAGExecutor builds DAG]
  B --> C{resumeFromSnapshot}
  C -- true --> D[Include all enabled blocks]
  C -- false --> E[Build trigger-reachable DAG]
  D --> F[Execution engine reads remainingEdges]
  F --> G[Find downstream target nodes]
  G --> H[Queue ready continuation blocks]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
  A[Snapshot resume] --> B[DAGExecutor builds DAG]
  B --> C{resumeFromSnapshot}
  C -- true --> D[Include all enabled blocks]
  C -- false --> E[Build trigger-reachable DAG]
  D --> F[Execution engine reads remainingEdges]
  F --> G[Find downstream target nodes]
  G --> H[Queue ready continuation blocks]
Loading

Reviews (1): Last reviewed commit: "fix(hitl): build the full enabled-block ..." | Re-trigger Greptile

@icecrasher321 icecrasher321 merged commit ff16b1b into staging Jul 1, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/hitl-executor branch July 1, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant